let config, gameState, funInLoop;
let asset, gameRecord;
let ctrller = {};

// 设置控制
const keys = {
    KeyW: false,
    KeyS: false,
    KeyA: false,
    KeyD: false,
    KeyH: false,
    Space: false,
    Escape: false,
};

const moveKeys = ['KeyA', 'KeyD', 'KeyW', 'KeyS'];

// 皮肤
const skins = {
    one: {
        front: 'url("skins/one/front.png")',
        back: 'url("skins/one/back.png")',
        left: 'url("skins/one/left.png")',
        right: 'url("skins/one/right.png")',
        frontMove: 'url("skins/one/frontMove.png")',
        backMove: 'url("skins/one/backMove.png")',
        leftMove: 'url("skins/one/leftMove.png")',
        rightMove: 'url("skins/one/rightMove.png")',
    },
    two: {
        front: 'url("skins/two/front.png")',
        back: 'url("skins/two/back.png")',
        left: 'url("skins/two/left.png")',
        right: 'url("skins/two/right.png")',
        frontMove: 'url("skins/two/frontMove.png")',
        backMove: 'url("skins/two/backMove.png")',
        leftMove: 'url("skins/two/leftMove.png")',
        rightMove: 'url("skins/two/rightMove.png")',
    },
    three: {
        front: 'url("skins/three/front.png")',
        back: 'url("skins/three/back.png")',
        left: 'url("skins/three/left.png")',
        right: 'url("skins/three/right.png")',
        frontMove: 'url("skins/three/frontMove.png")',
        backMove: 'url("skins/three/backMove.png")',
        leftMove: 'url("skins/three/leftMove.png")',
        rightMove: 'url("skins/three/rightMove.png")',
    },
    four: {
        front: 'url("skins/four/front.png")',
        back: 'url("skins/four/back.png")',
        left: 'url("skins/four/left.png")',
        right: 'url("skins/four/right.png")',
        frontMove: 'url("skins/four/frontMove.png")',
        backMove: 'url("skins/four/backMove.png")',
        leftMove: 'url("skins/four/leftMove.png")',
        rightMove: 'url("skins/four/rightMove.png")',
    },
};

const skinsArr = [...Object.values(skins)]; // 展开运算符，这一步操作好像多余了、、、、、